package com.feiyue.learning.distributionlock;

public abstract class AbstractLock implements Lock {

    @Override
    public void getLock() {
        if (tryLock()) {
            System.out.println("get lock");
        } else {
            waitLock();
            getLock();
        }
    }

    public abstract boolean tryLock();
    public abstract void waitLock();
}
